package com.zhaowb.springcloud.admin.mapper;

import com.zhaowb.springcloud.admin.entity.Element;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * Created with IDEA
 *
 * @author zhaowb
 * @date 2018/11/1 10:17
 */
@Repository
public interface ElementMapper extends Mapper<Element> {

    /**
     * 根据用户id查询权限资源
     *
     * @param userId 用户id
     * @return
     */
    List<Element> selectAuthorityElementByUserId(@Param("userId") String userId);

    /**
     * 根据用户id查询权限菜单
     *
     * @param userId 用户id
     * @param menuId 菜单id
     * @return
     */
    List<Element> selectAuthorityMenuElementByUserId(@Param("userId") String userId, @Param("menuId") String menuId);
}